{extend name="$_tpl_public_layout_danceadmin"/}


{block name="breadcrumb"}
<ol class="breadcrumb">
	<li class="breadcrumb-item"><a href="{:url('admin/index/index')}">{:config('system.site_title')}</a></li>
	<li class="breadcrumb-item"><a href="{:url('admin/authRule/index')}">{$sideName}</a></li>
</ol>
{/block}


{block name="pageheader"}
{$sideName}
{/block}


{block name="content"}
<div class="card mb-3">
	<div class="card-body">
		<div>筛选总记录：{$count}</div>
		<a href="{:url('admin/authRule/ruleCheck')}" target="_blank">检测错误菜单 </a>
	</div>
</div>

<div class="card card-intro mb-3">
	<div class="card-header">
		<ul class="nav nav-tabs">
			<?php
				$active = $cid == 0 ? 'active' : '';
			?>
			<li class="nav-item"><a class="nav-link {$active}" href="{:url('admin/authRule/index')}">全部</a></li>
			{volist name="cateList" id="vo"}
				<?php
					$active = $cid == $vo['id'] ? 'active' : '';
				?>
				<li class="nav-item"><a class="nav-link {$active}" href="{:url('admin/authRule/index', ['cid'=>$vo['id']])}">{$vo['name']}</a></li>
			{/volist}
		</ul>
	</div>
	<div class="card-body">
		<div class="dataTable-toolbar">
			<a href="{:url('admin/authRule/add')}" class="btn btn-primary btn-sm dataTable-add">添加</a>
		</div>
		<form method="post" action="{:url('admin/authRule/listorders')}" class="J_ajaxForm">
			<table class="table table-striped table-bordered table-hover dataTable-table">
				<thead>
					<tr>
						<th width="50">排序</th>
						<th width="76">ID</th>
						<th width="150">名称</th>
						<th width="150">module</th>
						<th width="150">controller</th>
						<th width="150">action</th>
						<th minwidth="150">附属菜单控制器</th>
						<th width="120">状态</th>
						<th width="120">操作</th>
					</tr>
				</thead>
				<tbody>
					{volist name="tree" id="vo"}
					<tr>
						<td><input type="text" name="vieworders[{$vo['id']}]" value="{$vo['vieworder']}" class="form-control" /></td>
						<td>{$vo['id']}</td>
						<td>{$vo['name']}</td>
						<td>{$vo['module']}</td>
						<td>{$vo['controller']}</td>
						<td>{$vo['action']}</td>
						<td>{$vo['subsidiary']}</td>
						<td>
							状态：{$vo['state_show']|raw}
							<br>显示：{$vo['display_show']|raw}
							<br>独立菜单：{$vo['is_selfmenu_show']|raw}
						</td>
						<td>
							<a href="{:url('admin/authRule/add', ['id'=>$vo['id']])}" class="btn btn-primary btn-xs dataTable-add">编辑</a>
							<a href="{:url('admin/authRule/doDelete', ['id'=>$vo['id']])}" class="btn btn-danger btn-xs dataTable-delete J_layerConfirm" data-tip="您确定要执行删除操作吗？">删除</a>
							{if condition="0 && $adminInfo['groupid'] == 1"}
							<a href="{:url('admin/authRule/optimizePopup', ['id'=>$vo['id']])}" class="J_layerPcnewDialog" data-tip="确认优化ID吗？">优化ID(备用)</a>
							{/if}
						</td>
					</tr>
					{volist name="vo['childs']" id="vo2"}
					<tr>
						<td><input type="text" name="vieworders[{$vo2['id']}]" value="{$vo2['vieworder']}" class="form-control" /></td>
						<td>{$vo2['id']}</td>
						<td>└─&nbsp;{$vo2['name']}</td>
						<td>{$vo2['module']}</td>
						<td>{$vo2['controller']}</td>
						<td>{$vo2['action']}</td>
						<td>{$vo2['subsidiary']}</td>
						<td>
							状态：{$vo2['state_show']|raw}
							<br>显示：{$vo2['display_show']|raw}
							<br>独立菜单：{$vo2['is_selfmenu_show']|raw}
						</td>
						<td>
							<a href="{:url('admin/authRule/add', ['id'=>$vo2['id']])}" class="btn btn-primary btn-xs dataTable-add">编辑</a>
							<a href="{:url('admin/authRule/doDelete', ['id'=>$vo2['id']])}" class="btn btn-danger btn-xs dataTable-delete J_layerConfirm" data-tip="您确定要执行删除操作吗？">删除</a>
							{if condition="0 && $adminInfo['groupid'] == 1"}
							<a href="{:url('admin/authRule/optimizePopup', ['id'=>$vo2['id']])}" class="J_layerPcnewDialog" data-tip="确认优化ID吗？">优化ID(备用)</a>
							{/if}
						</td>
					</tr>
					{volist name="vo2['subs']" id="vo3"}
					<tr>
						<td><input type="text" name="vieworders[{$vo3['id']}]" value="{$vo3['vieworder']}" class="form-control" /></td>
						<td>{$vo3['id']}</td>
						<td>└───&nbsp;{$vo3['name']}</td>
						<td>{$vo3['module']}</td>
						<td>{$vo3['controller']}</td>
						<td>{$vo3['action']}</td>
						<td>{$vo3['subsidiary']}</td>
						<td>
							状态：{$vo3['state_show']|raw}
							<br>显示：{$vo3['display_show']|raw}
							<br>独立菜单：{$vo3['is_selfmenu_show']|raw}
						</td>
						<td>
							<a href="{:url('admin/authRule/add', ['id'=>$vo3['id']])}" class="btn btn-primary btn-xs dataTable-add">编辑</a>
							<a href="{:url('admin/authRule/doDelete', ['id'=>$vo3['id']])}" class="btn btn-danger btn-xs dataTable-delete J_layerConfirm" data-tip="您确定要执行删除操作吗？">删除</a>
							{if condition="0 && $adminInfo['groupid'] == 1"}
							<a href="{:url('admin/authRule/optimizePopup', ['id'=>$vo3['id']])}" class="J_layerPcnewDialog" data-tip="确认优化ID吗？">优化ID(备用)</a>
							{/if}
						</td>
					</tr>
					{/volist}
					{/volist}
					{/volist}
				</tbody>
			</table>
			<div class="dataTable-controll">
				<button type="submit" class="btn btn-success btn-sm dataTable-vieworder J_ajaxSubmit">提交排序</button>
			</div>
		</form>
		<div class="dataTable-pages">{$pageShow|raw}</div>
	</div>
</div>
{/block}


{block name="script"}
{/block}